package com.weng.bigdata.core.warehouse.enums;

/*
 *  数仓类型枚举
 * @author wengzhonghui
 * @date 17:02 2019/9/25
 */

public enum WarehouseTypesEnum {

    HIVE("hive"),
    MYSQL("mysql");


    private String type;

    WarehouseTypesEnum(final String type) {
        this.type = type;
    }

    public String getName() {
        return name();
    }

    public String getValue() {
        return type;
    }

    public static WarehouseTypesEnum valueOfFormat(String format) {
        for( WarehouseTypesEnum sqlType : WarehouseTypesEnum.class.getEnumConstants()) {
            if(sqlType.type.equalsIgnoreCase(format))
                return sqlType;
        }
        throw new IllegalArgumentException("format:" + format + " is not a valid ");
    }
}
